const {sign,decode} = require('jsonwebtoken');

//服务器在验证完用户的用户名和密码之后
let user = {name:'zhangsan',age:18}
let token = sign(user, 'jwtSecret');
console.log(token);

let decodeUser = decode(token);
console.log(decodeUser);
